using System;
using System.Globalization;
using System.Windows.Data;

namespace Tryit.Converters
{
    public class BooleanToArchiveStatusConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            if (value is bool isArchived)
            {
                return isArchived ? "已归档" : "未归档";
            }
            return "未归档";
        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            if (value is string status)
            {
                return status == "已归档";
            }
            return false;
        }
    }
} 